package com.devunion.salon.core.model.security;

import com.devunion.salon.core.model.BaseSalonEntity;
import com.devunion.salon.core.model.Person;

import javax.persistence.Entity;
import javax.persistence.OneToOne;

/**
 * User don't hold assigned roles to prevent many objects to be loaded in memory (session),
 * instead ot this security service should be created and used.
 *
 * @author spetrakovsky
 */
@Entity
public class PersonRole extends BaseSalonEntity {

    @OneToOne
    private User user;

    @OneToOne
    private Role role;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }
}
